package com.pactera.madp.cp.job;

import com.pactera.madp.cp.service.ICorpService;
import com.pactera.madp.cp.service.IWorkEmployeeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;

/**
 * @author: yangpengwei
 * @time: 2020/12/11 6:25 下午
 * @description 通讯录 - 定时任务
 */
@Slf4j
@Component
@EnableScheduling
@EnableAsync
public class WorkEmployeeSynLogic {

    @Autowired
    private ICorpService corpService;

    @Autowired
    private IWorkEmployeeService employeeService;

//    /**
//     * cron = 秒 分钟 小时 日 月 星期 年
//     * 每天晚上 0 点定时同步员工客户统计数据
//     */
//    @Async
//    @Scheduled(cron = "0 30 9 * * ?")
//    public void onAsyncEmpStatistic() {
//        List<CorpEntity> corpEntities = corpService.list();
//        for (CorpEntity entity : corpEntities) {
//            TenantContextHolder.setTenantId(entity.getTenantId());
//            employeeService.syncEmployeeStatistic(entity.getCorpId());
//        }
//
//    }

}
